<?php
/* @var $this UserController */
/* @var $model User */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id'=>'user-form',       
	'focus' => array($model, 'username'),
    //'enableClientValidation' => true,
    'enableAjaxValidation' => false,
	'type' => 'horizontal',
	'method' => 'post',
	'htmlOptions' => array(
		'enctype' => 'multipart/form-data'
	)
	
)); ?>
	<?php
	//untuk mengaktifkan tooltip
	$this->widget('application.extensions.tipsy.Tipsy', array(  
		'trigger' => 'hover',
		'gravity' => 's',
		'fade' => true,
		'items' => array(
			array('id' => 
				array('model' => $model, 'attribute' => 'foto'),
					'fallback' => 'File harus berformat PNG atau JPG dengan ukuran kurang dari 128KB.',
			),    
		),  
	));
	?>
	
	<div class="row">
		<?php echo $form->labelEx($model,'foto'); ?>
		<?php echo $form->fileField($model,'foto',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'foto'); ?>
	</div>
	

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Tambah Foto' : 'Simpan Foto'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
